package com.tech.thread.juc.locks.ReentrantLock;


import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Description:
 * @Author: zl
 * @Date: 2019/7/26 11:05
 */
public class Main {
    public static void main(String[] args) {
        final int threadCount = 2;
        final ExecutorService service = Executors.newFixedThreadPool(threadCount);
        //final Task task = new LockUnlockDemo();
        //final Task task = new TryLockDemo();
        final Task task = new LockInterruptiblyDemo();
        for (int i = 0; i < threadCount; i++) {
            service.execute(new Worker(task));
        }
        service.shutdown();
    }
}
